package me.hetong.caigou.ui.view;

import me.hetong.caigou.Global;
import me.hetong.caigou.entity.Zhao;
import me.hetong.caigou.ui.chessboard.ChessBoardWar;
import me.hetong.caigou.ui.chessboard.ChessboardWarImage;

public class LineChartWebViewHtmlToJavaConnector {
    public void selectMatchTableView(Integer value) {
        if (value != null && value >= 0) {
            if (!ChessBoardWar.isInfering) {
                if (Global.qipu != null && Global.qipu.getZhaoList() != null && Global.qipu.getZhaoList().size() > 0 && value < Global.qipu.getZhaoList().size()) {
                    Zhao zhao = Global.qipu.getZhaoList().get(value);
                    ChessboardWarImage.initChessList(zhao.getFen2());
                    ChessboardWarImage.setFromImageViewLocation(zhao.getX1(), zhao.getY1());
                    ChessboardWarImage.setToImageViewLocation(zhao.getX2(), zhao.getY2());
                    ChessBoardWar.index = value;
                    Global.engine.search(zhao);
                }
            }
        }
    }
}
